import {Component, OnInit} from '@angular/core';
import {UserService} from '../service/user.service';
import {Router} from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './user-home.component.html',
  styleUrls: ['./user-home.component.css'],
  providers: [UserService]
})
export class UserHomeComponent implements OnInit {
  tabIndex = 1;
  title = '我的收藏';

  constructor(private userService: UserService, private route: Router) {
  }

  ngOnInit() {
    this.route.navigateByUrl('/user/(userHome:details)');
  }

  changePassword() {

  }

  changeTitle(title: string) {
    this.title = title;
  }

  logout() {
    this.userService.logout();
  }
}
